package com.han.yrpc.registrycenter.localcache;

import com.han.yrpc.core.registry.ServiceInfo;
import org.springframework.stereotype.Component;

import java.util.Set;

@Component
public class ServiceDiscoverHandle {

    private final ServiceProvider serviceProvider;

    public ServiceDiscoverHandle(ServiceProvider serviceProvider) {
        this.serviceProvider = serviceProvider;
    }

    public Set<ServiceInfo> discover(String serviceName) {
        return serviceProvider.getService(serviceName);
    }

}
